// PurchaseDAO.java - 数据访问接口
package com.example.electricbicycle.dao;

import com.example.electricbicycle.po.PurchaseOrder;
import com.example.electricbicycle.po.Vehicle;
import java.sql.SQLException;
import java.util.List;

public interface PurchaseDAO {
    boolean addPurchaseOrder(PurchaseOrder order);
    boolean updatePurchaseOrder(PurchaseOrder order);
    boolean deletePurchaseOrder(int orderId);
    PurchaseOrder getPurchaseOrderById(int orderId);
    List<PurchaseOrder> getPurchaseOrdersBySalesman(int salesmanId);
    boolean isOrderEditable(int orderId);
    List<Vehicle> getAllVehicles();
    Vehicle getVehicleById(int id);
    int getTotalOrderCount(int salesmanId) throws SQLException;
    int getPendingOrderCount(int salesmanId) throws SQLException;
    int getApprovedOrderCount(int salesmanId) throws SQLException;
    List<PurchaseOrder> getFilteredOrders(int salesmanId, String type) throws SQLException;
    List<PurchaseOrder> getAllOrdersForSalesman(int salesmanId);
    boolean addVehicle(Vehicle vehicle);
    boolean updateVehicle(Vehicle vehicle);
    boolean deleteVehicle(int vehicleId);
}